<?php namespace web\home\controller;
/** .-------------------------------------------------------------------
 * |  Software: [HDPHP framework]
 * |      Site: www.hdphp.com
 * |-------------------------------------------------------------------
 * |    Author: 向军 <2300071698@qq.com>
 * |    WeChat: aihoudun
 * | Copyright (c) 2012-2019, www.houdunwang.com. All Rights Reserved.
 * '-------------------------------------------------------------------*/
//	前台首页控制器
class Common {
	//首页
	public function __construct() {
//	导航数据
		$navData=Db::table('category')->where('pid',0)->get();
		View::with('navData',$navData);
//	标签云
		$tagData=Db::table('tag')->get();
		foreach ($tagData as $k => $v) {
			$tagData[$k]['cun']=Db::table('article_tag')->join('article','article_aid','=','aid')->where('tag_tid',$v['tid'])->where('is_recycle',0)->count();
		}
		View::with('tagData',$tagData);
//	友情链接
		$linkData=Db::table('link')->get();
		View::with('linkData',$linkData);
		
	}
	
	
	
	
	
}